<?php
require_once ("../../../config/koneksi.php");
$ppk=$_GET['ppk'];


$sql_obat="select count(*)as banyak from tarif_obat where id_ppk='$ppk'";
$qry_obat=mysql_query($sql_obat);
$hasil_obat=mysql_fetch_array($qry_obat);

$sql_abhp="select count(*)as banyak from tarif_abhp where id_ppk='$ppk'";
$qry_abhp=mysql_query($sql_abhp);
$hasil_abhp=mysql_fetch_array($qry_abhp);

$sql_elektromedik="select count(*)as banyak from tarif_elektromedik where id_ppk='$ppk'";
$qry_elektromedik=mysql_query($sql_elektromedik);
$hasil_elektromedik=mysql_fetch_array($qry_elektromedik);

$sql_laboratorium="select count(*)as banyak from tarif_laboratorium where id_ppk='$ppk'";
$qry_laboratorium=mysql_query($sql_laboratorium);
$hasil_laboratorium=mysql_fetch_array($qry_laboratorium);

$sql_layanan="select count(*)as banyak from tarif_layanan where id_ppk='$ppk'";
$qry_layanan=mysql_query($sql_layanan);
$hasil_layanan=mysql_fetch_array($qry_layanan);

$sql_radiologi="select count(*)as banyak from tarif_radiologi where id_ppk='$ppk'";
$qry_radiologi=mysql_query($sql_radiologi);
$hasil_radiologi=mysql_fetch_array($qry_radiologi);

$sql_rehabilitasi="select count(*)as banyak from tarif_rehabilitasi where id_ppk='$ppk'";
$qry_rehabilitasi=mysql_query($sql_rehabilitasi);
$hasil_rehabilitasi=mysql_fetch_array($qry_rehabilitasi);

$sql_tindakan="select count(*)as banyak from tarif_tindakan where id_ppk='$ppk'";
$qry_tindakan=mysql_query($sql_tindakan);
$hasil_tindakan=mysql_fetch_array($qry_tindakan);

//hasil
$arr_hasil=array('jumlah_obat'=>$hasil_obat['banyak'],'jumlah_abhp'=>$hasil_abhp['banyak'],
				'jumlah_elektromedik'=>$hasil_elektromedik['banyak'],'jumlah_laboratorium'=>$hasil_laboratorium['banyak'],
				'jumlah_layanan'=>$hasil_layanan['banyak'],'jumlah_radiologi'=>$hasil_radiologi['banyak'],
				'jumlah_rehabilitasi'=>$hasil_rehabilitasi['banyak'],'jumlah_tindakan'=>$hasil_tindakan['banyak']);
echo json_encode($arr_hasil);
exit;
?>